import grails.converters.*
import KML

class EventdataTests extends GroovyTestCase {
    void testSomething() {
        def eds = []

        def device =   new Device("imeiNumber": 24344618)

        Eventdata d1 = new Eventdata()
        d1.address = "test add1"
        d1.altitude = 12
        d1.belongsTo = device
        d1.latitude = 43.5
        d1.longitude = -110
        
        Eventdata d2 = new Eventdata()
        d2.address = "test add1"
        d2.altitude = 12
        d2.belongsTo = device
        d2.latitude = 43.50005
        d2.longitude = -110

        def xx = new HashSet()
        xx.add(d1)
        xx.add(d2)

        def writer = new StringWriter()
        def  kml = new KML()
        kml.setTarget(xx)
        kml.render(writer)

        println writer.toString()
        println "OK"
    }
}
